regular expression and finite automata